var inf;
window.oncontextmenu=function(e){
	e.preventDefault();
}
window.onload=function(){
    //btnAnimation();
    var xmlhttp;
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		    inf=xmlhttp.responseText;
			inf = eval("(" + inf + ")");
		}
	}
	xmlhttp.open("GET","https://raw.onmicrosoft.cn/Bing-Wallpaper-Action/main/data/zh-CN_all.json",true);
	xmlhttp.send();


	document.addEventListener('touchstart',function (event) { 
		if(event.touches.length>=2){ 
		  event.preventDefault(); 
		} 
	}) 
	
	document.addEventListener('touchmove',function (event) { 
		if(event.touches.length>=2){ 
		  event.preventDefault(); 
		} 
	}) 
	
	document.addEventListener('touchend',function (event) { 
		if(event.touches.length>=2){ 
		  event.preventDefault(); 
		} 
	})
	setIndexMargin();
	//setViewingHeight();
	var r=setInterval(getTime,1000);
	setIframeHeight(document.getElementById('web-view'));

}


function setPageMargin(id){
	var top=document.getElementById("topic").clientHeight;
	var h=window.screen.height;
	h=h-top;
	top=top*1.5;
	document.getElementById(id).style.height=h+"px";
	document.getElementById(id).style.marginTop=top+"px";
}
function setIndexMargin(){
	var top=document.getElementById("topic").clientHeight;
	var h=window.screen.height;
	h=h-top;
	document.getElementById("index").style.height=h+"px";
	document.getElementById("index").style.marginTop=top+"px";
}
function setViewingHeight(){
	var h=document.getElementById("viewing").clientHeight;
	document.getElementById("web-view").setAttribute("height",h);
}
function openPage(id){

}

function url(url){
	//url()可打开drl
	open(url);
}
/*unction btnAnimation(){
    var list=document.getElementsByClassName("pb");
    console.log(list);
	for(var i=0;i<=list.length;i++){

        list[i].onclick=function(){
            this.style.padding="20px";
			sleep(2000);
			this.style.padding="10px";
			
        }
	
	}
        
    };

function sleep(d){
	for(var t = Date.now();Date.now() - t <= d;);
}*/
	  